package expressions.slogo;

import java.util.List;
import expressions.Operator;

/**
 * Negates a number.
 * 
 * This class intentionally lacks a @Token annotation: it doesn't get created
 * when tokenizing, but a Subtract object might get converted to a Negate object
 * if the real meaning of the - sign was Negate.
 * 
 */
public class Negate extends Operator<Double>
{

    public Negate()
    {
        super(1);
    }

    @Override
    public int priority()
    {
        return 10;
    }

    @Override
    protected Double combineResults(List<Double> results)
    {
        return -results.get(0);
    }

}
